package org.nepu.scr.indexrate.converter.compliancerate.operationreliability;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.compliancerate.operationreliability.ImproveA111;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class ImproveA111Converter implements AttributeConverter<ImproveA111, String> {
    @Override
    public String convertToDatabaseColumn(ImproveA111 improveA111) {
        return JSONUtil.toJsonStr(improveA111);
    }

    @Override
    public ImproveA111 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, ImproveA111.class);
    }
}
